UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E3iK4e9v7XkuS6JNVmTEeKPhVjkDtzgvG22z0dVEuR4='
WHERE
key_id = '6a25660af97a43f23493c92bdee184beb57771d2f73abef3d2f4c37c7a696dc5'
AND (
token = 'E3iK4e9v7XkuS6JNVmTEeKPhVjkDtzgvG22z0dVEuR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)