UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xh4bGdcmbEi+i1WyFIRHvbu+Ndm4/1CApSIERSsh8h8=' 
WHERE 
  key_id = 'b3569d7dfc672b0254b4488bae9849f12f00ac7635d30e241376bc10d8d1e273' 
  AND (
    token = 'Xh4bGdcmbEi+i1WyFIRHvbu+Ndm4/1CApSIERSsh8h8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038