UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EXqWxglYnOPANhsOGLhQghJoYS28Ryk8v04XDGDIv4M=' 
WHERE 
  key_id = 'f3a29597a0c1b1eee10eca527629764bc42add82317ab1666ec7c5a90cb0cede' 
  AND (
    token = 'EXqWxglYnOPANhsOGLhQghJoYS28Ryk8v04XDGDIv4M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031