UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's/AzDAqfqD1GPIrV9OCcD49WGlJbsTcUi5JwWSt3+8g='
WHERE
key_id = '405f1a5d9fc7f15a552b0a62c7fb42dae2d37804f7c02a5f39b20da7f3fd3717'
AND (
token = 's/AzDAqfqD1GPIrV9OCcD49WGlJbsTcUi5JwWSt3+8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)