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