UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gi2E9eXBXu5xdgd4c9XwR04O21BZkiYJCNnwu1uDA6A='
WHERE
key_id = '579722e5cee1f9d6f55a9508a43319de1e48ec2ea0dd5eea03f9550b25d4cd46'
AND (
token = 'Gi2E9eXBXu5xdgd4c9XwR04O21BZkiYJCNnwu1uDA6A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)