UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U4GjHWr+sd+Sxi2eThezF5hoF2yWx1pmXbNp25/CQ2A='
WHERE
key_id = '6619203cb185a33073e27323d948a6d1c9c59eafb149745f32792feddeb2bd50'
AND (
token = 'U4GjHWr+sd+Sxi2eThezF5hoF2yWx1pmXbNp25/CQ2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)