UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'srrHxyyC3CcAO6yRGMw9YSCMjiESw/zAI70P4gJBGZg='
WHERE
key_id = '2309d7ff901bace5e94d1cac7fb9e54db07de308cb64bc0257593b1fb044a9c3'
AND (
token = 'srrHxyyC3CcAO6yRGMw9YSCMjiESw/zAI70P4gJBGZg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)