UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RSccu+WfA6A5k4dZmfxmcnz1KW8ueTcb5ptdR2rhsnI=' 
WHERE 
  key_id = 'f53b68feb786ab837eab61c47fdf9f51a9ac8b8cdb81455e421196281e4aae2d' 
  AND (
    token = 'RSccu+WfA6A5k4dZmfxmcnz1KW8ueTcb5ptdR2rhsnI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031