UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vszgBTQGIf86w3k716zEt8s1LCtUDuNkeiJPOu7Sa2g='
WHERE
key_id = 'c9d1f465bef6dc1bf582e1abadec20a2d5222d93dcfb6e76241c00111627c378'
AND (
token = 'vszgBTQGIf86w3k716zEt8s1LCtUDuNkeiJPOu7Sa2g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)