UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1hZenA+aXYxIt99x0Wly6ZF11cbxZTe7QvE0ElxEZYM=' 
WHERE 
  key_id = '38f4661a3d746ac3c4ad021a9c87950bb85fbdda3467ffd4aebe533069494e55' 
  AND (
    token = '1hZenA+aXYxIt99x0Wly6ZF11cbxZTe7QvE0ElxEZYM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054