UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qrQH5AVKRy3GDIXMbT52cLUIeUrGZ+yjRJ1ko4SSfQg='
WHERE
key_id = '79cde8a50058540c2d1adf09b8d0a17bf99788d27a3c8641cc0d610dffcbfa3c'
AND (
token = 'qrQH5AVKRy3GDIXMbT52cLUIeUrGZ+yjRJ1ko4SSfQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)