UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'McWSDVcnfs0bPXlSWVqO+jGZa0UD7CZcy8WZhHGLkUA='
WHERE
key_id = 'e72a3bb4ee243b048bfda00ca58a9e34079d1a800756ab5f2f20ebe276f30f3c'
AND (
token = 'McWSDVcnfs0bPXlSWVqO+jGZa0UD7CZcy8WZhHGLkUA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)