UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GTzpuoPUvb7eghpMBBmdFBo2Hbz/IKJtOA29VlDlZEA='
WHERE
key_id = 'e11849e613b60053f96346929e259f98224972d12c8e6586de7affa449c80df1'
AND (
token = 'GTzpuoPUvb7eghpMBBmdFBo2Hbz/IKJtOA29VlDlZEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)