UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'llRTRJlGDKn8qrFNB1t163FIR8XTwsaW1+XpU3e/qyE='
WHERE
key_id = '5f37b1fd81d80d97832f2be17a4d85ad04b695b3c052bee143accf8bd905c0ee'
AND (
token = 'llRTRJlGDKn8qrFNB1t163FIR8XTwsaW1+XpU3e/qyE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)