UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yQcgJCjy1IBbU+gDEvzjlN0/MeMSCX5lzF0hgPFOvhY=' 
WHERE 
  key_id = '76d6354f66b3c18c0547c644ad97584130ad13feb0f7ad9d40e8da4dffb50e06' 
  AND (
    token = 'yQcgJCjy1IBbU+gDEvzjlN0/MeMSCX5lzF0hgPFOvhY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069