UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tDV8KvVPzYqR/PwiYOZ8bMuTIWHLhsALSySbqbS/7f4='
WHERE
key_id = 'b87dfb619daffc515bbfa5ffdca714f408c7deedb416bcba70fe6ef039d50bf6'
AND (
token = 'tDV8KvVPzYqR/PwiYOZ8bMuTIWHLhsALSySbqbS/7f4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)