UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rrQtJNL3ZjR32i1RVfPH/lPc679EBImvdGKMFCIq4e4='
WHERE
key_id = 'bced26e67feb659110b1ff755b1548693ac9dbc287c952c2379b2a1b97396260'
AND (
token = 'rrQtJNL3ZjR32i1RVfPH/lPc679EBImvdGKMFCIq4e4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)