UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O6Z/+qjRGf3Y2mECXeL9N5rZtRgC/3jRO0KwknpByhI='
WHERE
key_id = 'b0b22e924708faa8d7e38d9b32e5f7adc019d18331962e2f58820d4fe9241771'
AND (
token = 'O6Z/+qjRGf3Y2mECXeL9N5rZtRgC/3jRO0KwknpByhI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)