UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X3RRC1vR6Tc9q9j5POkmwmpbg9h611FKTTYqPVa1TfY='
WHERE
key_id = '0063c4b9bb736e770264f9422df1004c0e1874292a4b2acc0b222d263ff9acb3'
AND (
token = 'X3RRC1vR6Tc9q9j5POkmwmpbg9h611FKTTYqPVa1TfY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)