UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pEacFH/fUWauqBN5P+5CYZVqRaqu7Eg36s/n/mSydDg='
WHERE
key_id = '3c3af6552ced824d6007873a130a210bef0a2018b94348de01007fcc3317fb6d'
AND (
token = 'pEacFH/fUWauqBN5P+5CYZVqRaqu7Eg36s/n/mSydDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)