UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HnQ7Pc67S5+q17w5/OVZ0t4TDI38fduDSMLe1Gwk8uA='
WHERE
key_id = '05e03bca0284bb2210ce0e8cfb3e06ec610340659878258a65e2fb9a972329c5'
AND (
token = 'HnQ7Pc67S5+q17w5/OVZ0t4TDI38fduDSMLe1Gwk8uA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)