UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ouAfB84EDiEBEN20rpu0VskgfcVTpRs9VEe7f9BDZlM='
WHERE
key_id = '282d8190c848b0d683af201c25ef689720a0fb6e58f805c231783826774edfc9'
AND (
token = 'ouAfB84EDiEBEN20rpu0VskgfcVTpRs9VEe7f9BDZlM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)