UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y35qaX+BmK/FRNmJ2LWjr9RVg5PMnoUiTv965oC2Cfo='
WHERE
key_id = '7d5177625052bfec874fb7cbbd0b05536c8241f60147a7188afdeec7d60ed669'
AND (
token = 'Y35qaX+BmK/FRNmJ2LWjr9RVg5PMnoUiTv965oC2Cfo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)