UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5oX2d4Tj0G1dKbJMzjp2S4fvtC1FvjxRQWv7wmpy5Dg='
WHERE
key_id = '8190b56dbbcba8b3caa5559c8c6a210208167cb0ee6486f24ed0fd47e9d5999c'
AND (
token = '5oX2d4Tj0G1dKbJMzjp2S4fvtC1FvjxRQWv7wmpy5Dg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)