UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dYjqBm6wZYCGiVvOua4ThMpPyHMq/Na/mY1DdGCbwv8='
WHERE
key_id = '0cb17f9ec99c32a631deb0b293dc8aa101abff3f2d183f1a4c635c6f3f25a7b1'
AND (
token = 'dYjqBm6wZYCGiVvOua4ThMpPyHMq/Na/mY1DdGCbwv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)