UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IxwOehHGbBPi+uOdj0vrm/ro/7WCSIKEFR0jVaHVz5c='
WHERE
key_id = 'edaea52655807385306a9f42a72e211226f2f3c7b464b8810e81e00a8d9052c0'
AND (
token = 'IxwOehHGbBPi+uOdj0vrm/ro/7WCSIKEFR0jVaHVz5c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)