UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n4HOeeol86cjKNH7qFafDqHtPdWv8hMmC0SEFUDrNEo='
WHERE
key_id = '4f64979afc4e34def8da4f8f53ead4a6f176887b8d8437cd4760c1ecf55a4144'
AND (
token = 'n4HOeeol86cjKNH7qFafDqHtPdWv8hMmC0SEFUDrNEo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)