UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UL91eQwu3zOFwEi8RgvsV+DXih5j9wJzfrnnQs3/mgo='
WHERE
key_id = '3e5560d63de451bffeb6c0ba57c8e72078baa37ae7cffabc15bfc58a719f1bbc'
AND (
token = 'UL91eQwu3zOFwEi8RgvsV+DXih5j9wJzfrnnQs3/mgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)