UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6KjLmWMp4e/39IJqxrmD4/6MD6Jg0uZyWKGSwb9aB2I='
WHERE
key_id = '6b561421eefaf3c883b99bb63208c23f9af3c9513857a3e5656e6883c8c8b3cf'
AND (
token = '6KjLmWMp4e/39IJqxrmD4/6MD6Jg0uZyWKGSwb9aB2I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)