UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TcySp8ArydaC3yBkSl0jmDpPQy179xzvk12QD5L6MTo='
WHERE
key_id = '4824c83412559078af2b2242e52b6c9f66f71174ed21693941f853936649d565'
AND (
token = 'TcySp8ArydaC3yBkSl0jmDpPQy179xzvk12QD5L6MTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)