UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pc6GUbJakAuUqhhCPcgDY5GGHXRL6+JzOKhNM3kBhTM='
WHERE
key_id = 'a410c81b50b236798ff3cacd0208ead8d5b3012283bad0cf048a38d19b5d08fb'
AND (
token = 'pc6GUbJakAuUqhhCPcgDY5GGHXRL6+JzOKhNM3kBhTM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)